package socketmessage.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.pagehelper.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import socketmessage.entity.Socketmessage;
import socketmessage.mapper.SocketmessageMapper;
import socketmessage.service.Socketmessageservice;

import java.util.Date;
import java.util.List;

@Service
public class Socketmessageserviceimpl implements Socketmessageservice {

    @Autowired
    private SocketmessageMapper socketmessageMapper;
    @Override
    public int deleteByPrimaryKey(Integer id) {
        return socketmessageMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(Socketmessage record) {
        return socketmessageMapper.insert(record);
    }

    @Override
    public int insertSelective(Socketmessage record) {
        record.setCreatetime(new Date());
        return socketmessageMapper.insertSelective(record);
    }

    @Override
    public Socketmessage selectByPrimaryKey(Integer id) {
        return socketmessageMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(Socketmessage record) {
        return socketmessageMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(Socketmessage record) {
        return socketmessageMapper.updateByPrimaryKey(record);
    }


    @Override
    public IPage<Socketmessage> selectPage(Integer pageNum,Integer pageSize, String usersocketid) {
        Page<Socketmessage> userPage = new Page<>(pageNum,pageSize);
        return null;
    }

    @Override
    public int deleteByopenid(String usermessageid) {
        return socketmessageMapper.deleteByopenid(usermessageid);
    }


}
